//
//  KLCurrencyHelper.m
//  TestArray
//
//  Created by apple on 2017/12/6.
//  Copyright © 2017年 bonc. All rights reserved.
//

#import "KLCurrencyHelper.h"

#import "pinyin.h"

@implementation KLCurrencyHelper

+ (NSArray *)defaultMainCurrencyAbbreviation {
    return @[@"CNY", @"USD", @"HKD", @"EUR"];
}

+ (NSDictionary *)defaultMainCurrencyExchangeRateDictionary {
    return  @{
                @"CNYCNY":@1.0000,
                @"CNYUSD":@0.1512,
                @"CNYHKD":@0.1813,
                @"CNYEUR":@0.1272,
                
                @"USDCNY":@6.6137,
                @"USDUSD":@1.0000,
                @"USDHKD":@7.8125,
                @"USDEUR":@0.8411,
                
                @"HKDCNY":@0.8465,
                @"HKDUSD":@0.1512,
                @"HKDHKD":@1.0000,
                @"HKDEUR":@0.1077,
                
                @"EURCNY":@7.6830,
                @"EURUSD":@1.1889,
                @"EURHKD":@9.2883,
                @"EUREUR":@1.0000,
                };
}

+ (NSDictionary *)defaultCurrencyExchangeRateDictionary{
    return @{
             @"USDAED":@3.672502,
             @"USDAFN":@69.690002,
             @"USDALL":@110.349998,
             @"USDAMD":@483.600006,
             @"USDANG":@1.780097,
             @"USDAOA":@165.098007,
             @"USDARS":@18.408955,
             @"USDAUD":@1.276406,
             @"USDAWG":@1.78,
             @"USDAZN":@1.699605,
             @"USDBAM":@1.628696,
             @"USDBBD":@2,
             @"USDBDT":@82.669998,
             @"USDBGN":@1.626702,
             @"USDBHD":@0.376594,
             @"USDBIF":@1750.97998,
             @"USDBMD":@1,
             @"USDBND":@1.334799,
             @"USDBOB":@6.860349,
             @"USDBRL":@3.2505,
             @"USDBSD":@1,
             @"USDBTC":@6.6e-5,
             @"USDBTN":@63.650002,
             @"USDBWP":@9.866697,
             @"USDBYN":@2.029755,
             @"USDBYR":@19600,
             @"USDBZD":@1.997799,
             @"USDCAD":@1.25388,
             @"USDCDF":@1565.487991,
             @"USDCHF":@0.97713,
             @"USDCLF":@0.02239,
             @"USDCLP":@606.97998,
             @"USDCNY":@6.500901,
             @"USDCOP":@2900.800049,
             @"USDCRC":@565.080017,
             @"USDCUC":@1,
             @"USDCUP":@26.5,
             @"USDCVE":@91.720001,
             @"USDCZK":@21.194018,
             @"USDDJF":@176.830002,
             @"USDDKK":@6.19159,
             @"USDDOP":@47.56989,
             @"USDDZD":@114.280998,
             @"USDEGP":@17.670044,
             @"USDERN":@15.290283,
             @"USDETB":@27.209999,
             @"USDEUR":@0.831502,
             @"USDFJD":@2.066992,
             @"USDFKP":@0.736798,
             @"USDGBP":@0.73999,
             @"USDGEL":@2.582203,
             @"USDGGP":@0.739978,
             @"USDGHS":@4.528498,
             @"USDGIP":@0.736983,
             @"USDGMD":@47.349998,
             @"USDGNF":@8997.999727,
             @"USDGTQ":@7.335989,
             @"USDGYD":@205.270004,
             @"USDHKD":@7.815102,
             @"USDHNL":@23.518999,
             @"USDHRK":@6.173803,
             @"USDHTG":@62.630001,
             @"USDHUF":@256.700012,
             @"USDIDR":@13471,
             @"USDILS":@3.445097,
             @"USDIMP":@0.739978,
             @"USDINR":@63.471103,
             @"USDIQD":@1184,
             @"USDIRR":@36056.000392,
             @"USDISK":@104.150002,
             @"USDJEP":@0.739978,
             @"USDJMD":@122.970001,
             @"USDJOD":@0.707499,
             @"USDJPY":@112.330002,
             @"USDKES":@103.24997,
             @"USDKGS":@68.931011,
             @"USDKHR":@4029.899902,
             @"USDKMF":@410.999634,
             @"USDKPW":@900.000107,
             @"USDKRW":@1064.51001,
             @"USDKWD":@0.3012,
             @"USDKYD":@0.81988,
             @"USDKZT":@333.119995,
             @"USDLAK":@8282.999757,
             @"USDLBP":@1505.492896,
             @"USDLKR":@153.600006,
             @"USDLRD":@125.180299,
             @"USDLSL":@12.339886,
             @"USDLTL":@3.048698,
             @"USDLVL":@0.62055,
             @"USDLYD":@1.349799,
             @"USDMAD":@9.331299,
             @"USDMDL":@17.077012,
             @"USDMGA":@3201.999858,
             @"USDMKD":@50.909771,
             @"USDMMK":@1355.99969,
             @"USDMNT":@2420.999874,
             @"USDMOP":@8.0471,
             @"USDMRO":@350.999862,
             @"USDMUR":@33.000205,
             @"USDMVR":@15.570311,
             @"USDMWK":@713.450012,
             @"USDMXN":@19.3915,
             @"USDMYR":@4.011987,
             @"USDMZN":@58.360001,
             @"USDNAD":@12.36034,
             @"USDNGN":@357.000374,
             @"USDNIO":@30.660066,
             @"USDNOK":@8.11164,
             @"USDNPR":@101.655998,
             @"USDNZD":@1.409099,
             @"USDOMR":@0.384296,
             @"USDPAB":@1,
             @"USDPEN":@3.228499,
             @"USDPGK":@3.228502,
             @"USDPHP":@49.769963,
             @"USDPKR":@110.419998,
             @"USDPLN":@3.454302,
             @"USDPYG":@5601.000326,
             @"USDQAR":@3.639802,
             @"USDRON":@3.842195,
             @"USDRSD":@97.842303,
             @"USDRUB":@57.2869,
             @"USDRWF":@835.75,
             @"USDSAR":@3.749899,
             @"USDSBD":@7.770498,
             @"USDSCR":@13.575992,
             @"USDSDG":@6.998202,
             @"USDSEK":@8.175202,
             @"USDSGD":@1.328595,
             @"USDSHP":@0.736968,
             @"USDSLL":@7630.000016,
             @"USDSOS":@556.999953,
             @"USDSRD":@7.40998,
             @"USDSTD":@20379.300781,
             @"USDSVC":@8.750518,
             @"USDSYP":@514.97998,
             @"USDSZL":@12.358966,
             @"USDTHB":@32.250372,
             @"USDTJS":@8.817597,
             @"USDTMT":@3.41,
             @"USDTND":@2.491901,
             @"USDTOP":@2.212299,
             @"USDTRY":@3.764802,
             @"USDTTD":@6.701398,
             @"USDTWD":@29.583023,
             @"USDTZS":@2237.999697,
             @"USDUAH":@27.834999,
             @"USDUGX":@3634.000089,
             @"USDUSD":@1,
             @"USDUYU":@28.719999,
             @"USDUZS":@8099.999493,
             @"USDVEF":@9.975028,
             @"USDVND":@22707,
             @"USDVUV":@107.099998,
             @"USDWST":@2.562902,
             @"USDXAF":@545.01001,
             @"USDXAG":@0.058192,
             @"USDXAU":@0.00076,
             @"USDXCD":@2.698357,
             @"USDXDR":@0.701111,
             @"USDXOF":@562.559998,
             @"USDXPF":@100.124965,
             @"USDYER":@249.949997,
             @"USDZAR":@12.359404,
             @"USDZMK":@9001.199391,
             @"USDZMW":@10.030058,
             @"USDZWL":@322.355011
             };
}

+ (NSArray <NSDictionary *>*)allCurrencies {
    return @[
                 @{@"name":@"澳元", @"abbreviation":@"AUD", @"symbol":@"$", @"nation":@"澳大利亚",  },
                 @{@"name":@"埃及镑", @"abbreviation":@"EGP", @"symbol":@"Le", @"nation":@"埃及",   },
                 @{@"name":@"澳门币", @"abbreviation":@"MOP", @"symbol":@"MOP$", @"nation":@"澳门",   },

                 @{@"name": @"巴拉圭瓜拉尼", @"abbreviation":@"PYG", @"symbol": @"₲", @"nation":@"巴拉圭",  },
                 @{@"name": @"巴西雷亚尔", @"abbreviation":@"BRL", @"symbol": @"R$", @"nation":@"巴西",  },
                 @{@"name": @"秘鲁新索尔", @"abbreviation":@"PEN", @"symbol": @"S/.", @"nation":@"秘鲁",  },
                 @{@"name": @"比特币", @"abbreviation":@"BTC", @"symbol": @"฿", @"nation":@"非国家和地区",  },
                 @{@"name": @"冰岛克朗",@"abbreviation": @"ISK",@"symbol": @"Kr", @"nation":@"冰岛",  },
                 @{@"name": @"铂", @"abbreviation":@"XPT", @"symbol": @"﹒克",@"nation":@"非国家和地区",  },

                 @{@"name": @"朝鲜币", @"abbreviation":@"KPW", @"symbol": @"₩", @"nation":@"朝鲜",  },

                 @{@"name": @"丹麦币", @"abbreviation":@"DKK", @"symbol": @"kr", @"nation":@"丹麦",  },

                 @{@"name": @"俄罗斯卢布", @"abbreviation":@"RUB", @"symbol": @"₽",@"nation":@"俄罗斯",  },

                 @{@"name": @"菲律宾比绍", @"abbreviation":@"PHP", @"symbol": @"₱", @"nation":@"菲律宾",  },

                 @{@"name": @"港币", @"abbreviation":@"HKD", @"symbol": @"$", @"nation":@"香港", },

                 @{@"name": @"韩币", @"abbreviation":@"KRW", @"symbol": @"₩", @"nation":@"韩国",  },

                 @{@"name": @"加纳塞地", @"abbreviation":@"GHS", @"symbol": @"₵", @"nation":@"加纳",  },
                 @{@"name": @"柬埔寨瑞尔", @"abbreviation":@"KHR", @"symbol": @"៛", @"nation":@"柬埔寨",  },
                 @{@"name": @"金", @"abbreviation":@"XAU", @"symbol": @"﹒克", @"nation":@"非国家和地区",  },

                 @{@"name": @"肯尼亚先令", @"abbreviation":@"KES", @"symbol": @"Ksh", @"nation":@"肯尼亚",  },

                 @{@"name": @"离岸人民币", @"abbreviation":@"CNH", @"symbol": @"¥", @"nation":@"非国家和地区",  },

                 @{@"name": @"马来西亚令吉", @"abbreviation":@"MYR", @"symbol": @"RM", @"nation":@"马来西亚",  },
                 @{@"name": @"美元", @"abbreviation":@"USD", @"symbol": @"$", @"nation":@"美国", },

                 @{@"name": @"南非兰特", @"abbreviation":@"ZAR", @"symbol": @"R", @"nation":@"南非",  },
                 @{@"name": @"尼日利亚奈拉", @"abbreviation":@"NGN", @"symbol": @"₦", @"nation":@"尼日利亚",  },
                 @{@"name": @"挪威克朗", @"abbreviation":@"NOK", @"symbol": @"Kr", @"nation":@"挪威",  },

                 @{@"name": @"欧元", @"abbreviation": @"EUR", @"symbol": @"€", @"nation":@"欧洲", },

                 @{@"name": @"强势玻利瓦尔", @"abbreviation":@"VEF", @"symbol": @"Bs.", @"nation":@"委内瑞拉",  },

                 @{@"name": @"人民币", @"abbreviation":@"CNY", @"symbol": @"¥", @"nation":@"中国", },
                 @{@"name": @"日元", @"abbreviation":@"JPY", @"symbol": @"¥", @"nation":@"日本",  },

                 @{@"name": @"苏丹镑", @"abbreviation":@"SDG", @"symbol": @"£", @"nation":@"苏丹",  },

                 @{@"name": @"泰铢", @"abbreviation":@"THB", @"symbol": @"฿",@"nation":@"泰国",  },

                 @{@"name": @"乌克兰格里夫纳", @"abbreviation":@"UAH", @"symbol": @"₴",@"nation":@"乌克兰",  },

                 @{@"name": @"新台币", @"abbreviation":@"TWD", @"symbol": @"NT$", @"nation":@"台湾",  },

                 @{@"name": @"伊朗里亚尔", @"abbreviation":@"IRR", @"symbol": @"﷼", @"nation":@"伊朗",  },
                 @{@"name": @"以色列新谢克尔", @"abbreviation":@"ILS", @"symbol": @"₪", @"nation":@"以色列",  },
                 @{@"name": @"银", @"abbreviation":@"XAG", @"symbol": @"﹒克", @"nation":@"非国家和地区",  },
                 @{@"name": @"英镑", @"abbreviation":@"GBP", @"symbol": @"£", @"nation":@"英国",  },
                 @{@"name": @"印度卢比", @"abbreviation":@"INR", @"symbol": @"Rs.", @"nation":@"印度",  },
                 @{@"name": @"印尼盾", @"abbreviation":@"IDR", @"symbol": @"Rp", @"nation":@"印度尼西亚",  },
                 @{@"name": @"越南盾", @"abbreviation":@"VND", @"symbol": @"₫", @"nation":@"越南",  },

                 @{@"name": @"智利比绍", @"abbreviation":@"CLP", @"symbol": @"$", @"nation":@"智利",  },

             ];
}

+ (NSArray <NSDictionary *>*)expensiveCurrencies {
    
    return @[
                  @{@"name": @"比特币", @"abbreviation":@"BTC", @"symbol": @"฿", @"nation":@"非国家和地区",  },
                  @{@"name": @"铂", @"abbreviation":@"XPT", @"symbol": @"﹒克",@"nation":@"非国家和地区",  },
                  @{@"name": @"金", @"abbreviation":@"XAU", @"symbol": @"﹒克", @"nation":@"非国家和地区",  },
                  @{@"name": @"银", @"abbreviation":@"XAG", @"symbol": @"﹒克", @"nation":@"非国家和地区",  },
             ];
}

+ (NSArray <NSDictionary *>*)nameArrayPinyinSortingWithNameArray:(NSArray <NSDictionary *>*)nameArray {
    NSMutableArray *totalArr = [NSMutableArray arrayWithCapacity:100];
    for (int i = 0; i < 26; i++)
    {
        //group name
        NSMutableDictionary *sectionDic = [NSMutableDictionary dictionaryWithCapacity:2];
        [sectionDic setObject:[NSString stringWithFormat:@"%c",'A'+i] forKey:@"group"];
        
        NSMutableArray *currencies = [NSMutableArray arrayWithCapacity:100];
        for (NSDictionary *currencyInfoDic in nameArray) {
            //item name
            char first= pinyinFirstLetter([currencyInfoDic[@"name"] characterAtIndex:0]);
            if ((first == ('a'+i) )||(first==  ('A'+i) )) {
                [currencies addObject:currencyInfoDic];
            }
        }
        NSArray *sectionArr = [currencies mutableCopy];
        [sectionDic setObject:sectionArr forKey:@"currencies"];
        [totalArr addObject:sectionDic];
    }
    //去除空的section
    NSMutableArray *refreshArr = [NSMutableArray arrayWithCapacity:100];
    for (NSDictionary *dic in totalArr) {
        NSArray *currencies = dic[@"currencies"];
        if (currencies.count == 0 || currencies == nil) {
        }else {
            [refreshArr addObject:dic];
        }
    }
    NSArray *result = [refreshArr mutableCopy];
    return result;
}

+ (NSArray <NSString *> *)getAllCurrencyGroupNames {
    NSArray *arr = [[self class] allCurrencies];
    NSArray *groupDicArr = [[self class] nameArrayPinyinSortingWithNameArray:arr];
    NSMutableArray *groupNamesArr = [NSMutableArray arrayWithCapacity:100];
    for (NSDictionary *dic in groupDicArr) {
        [groupNamesArr addObject:dic[@"group"]];
    }
    return [groupNamesArr mutableCopy];
}


+ (CGFloat)getCurrencyLayerExchangeRateFromCurrency1:(NSString *)cur1 toCurrency2:(NSString *)cur2 rateDictionary:(NSDictionary *)rateDic{
    //currencylayer.com的免费账户只能查基于美元的汇率，所以进行除法计算操作
    NSString *queryExchange1 = [NSString stringWithFormat:@"USD%@",cur1];
    NSString *queryExchange2 = [NSString stringWithFormat:@"USD%@",cur2];
    NSNumber *rate1 = [rateDic objectForKey:queryExchange1];
    NSNumber *rate2 = [rateDic objectForKey:queryExchange2];
#if CGFLOAT_IS_DOUBLE
    return rate2.doubleValue/rate1.doubleValue;
#else
    return rate2.floatValue/rate1.floatValue;
#endif
    
}

+ (NSArray<NSNumber *> *)defaultHistoryRateFromUSDToCNY{
    
    return @[
             /*2017-03*/
             @6.8863946,@6.8803738,@6.8854529,@6.8789274,@6.8792,@6.8799,@6.8733642,@6.8838188,@6.8904932,
             
             /*2017-04*/
             @6.8870365,@6.8897,@6.8799776,@6.8889715,@6.8875963,@6.8939861,@6.897155,@6.90425,@6.9041,@6.9038,@6.8922722,@6.8921489,@6.8855663,@6.8874,@6.88785,@6.8947,@6.8796107,@6.8832104,@6.8864563,@6.8878,@6.8847,@6.8847,@6.7899717,@6.8859363,@6.8853374,@6.8920848,@6.8973567,@6.8937867,@6.891157,@6.891157,
             
             /*2017-05*/
             @6.8932588,@6.8942493,@6.896267,@6.8962199,@6.9032011,@6.903267,@6.9020968,@6.9035022,@6.9059558,@6.9060,@6.9025011,@6.898883,@6.8983128,@6.9032599,@6.8936196,@6.8877659,@6.8829101,@6.8890098,@6.8844413,@6.8844413,@6.8549583,@6.8881785,@6.8900736,@6.8915577,@6.8693933,@6.8530842,@6.8529399,@6.8529779,@6.856803,@6.8152933,
             
             /*2017-06*/
             @6.8056244,@6.812239,@6.8099263,@6.8131561,@6.8035892,@6.796001,@6.7941592,@6.7990776,@6.80,@6.7972542,@6.7856051,@6.7981965,@6.7987425,@6.7937929,@6.806358,@6.8103552,@6.8104025,@6.8075295,@6.80,@6.8287916,@6.8294947,@6.8338141,@6.8362391,@6.8349615,@6.8344254,@6.8411338,@6.8109687,@6.7991115,@6.777384,
             
             /*2017-07*/
             @6.7793024,@6.7783572,@6.7968172,@6.7996717,@6.8006127,@6.8025623,@6.8025623,@6.8048505,@6.8049975,@6.80,@6.8033416,@6.8019625,@6.7874747,@6.7828515,@6.7767158,@6.7750026,@6.7608703,@6.7699675,@6.7461902,@6.7603883,@6.7665716,@6.7674616,@6.7405054,@6.7508045,@6.750566,@6.7533728,@6.737406871,@6.736901,@6.73,@6.7367228,@6.7274463,
             
             /*2017-08*/
             @6.7194606,@6.7218906,@6.7168219,@6.7314874,@6.7282417,@6.7520764,@6.7278785,@6.70,@6.6739697,@6.6468681,@6.6652718,@6.6621454,@6.6612513,@6.6712511,@6.6820649,@6.6910188,@6.6752879,@6.67,@6.6704168,@6.6706362,@6.6667461,@6.6614281,@6.660713,@6.6612183,@6.6476691,@6.6470421,@6.6190934,@6.6163296,@6.60,@6.5931258,@6.592147,
             
             /*2017-09*/
             @6.5611206,@6.5607565,@6.5553322,@6.526746,@6.5415784,@6.522778,@6.4901312,@6.48,@6.4788647,@6.4867984,@6.5268705,@6.5338853,@6.5380708,@6.5551232,@6.5540153,@6.5513605,@6.547196,@6.55,@6.5840379,@6.5749835,@6.59114375,@6.5926532,@6.5908191,@6.6038437,@6.6200799,@6.6372409,@6.6411149,@6.65,@6.6547881,@6.6548933,
             
             /*2017-10*/
             @6.6548526,@6.6556082,@6.65,@6.6501224,@6.6512093,@6.6515176,@6.655039,@6.6547135,@6.6520247,@6.6261072,@6.5752294,@6.588381,@6.58,@6.5790355,@6.5788256,@6.5836536,@6.5898811,@6.6220756,@6.6272132,@6.6146473,@6.6220955,@6.6201773,@6.62,@6.6392215,@6.6349987,@6.6392456,@6.6405609,@6.6499475,@6.6491752,@6.6540181,@6.6458108,
             
             /*2017-11*/
             @6.6324245,@6.63,@6.6088,@6.634543,@6.6356745,@6.6385101,@6.6345959,@6.6406122,@6.6280619,@6.6389386,@6.6417,@6.64,@6.6406,@6.63964,@6.636129,@6.6227819,@6.6287354,@6.6292173,@6.6260333,@6.634502,@6.6344728,@6.63,@6.611,@6.583,@6.600,@6.599,@6.5968,@6.6089,@6.60942,
             
             /*2017-12*/
             @6.6122,@6.612,@6.6147,@6.625,@6.6201157,@6.618121,@6.6152377,@6.6194583,@6.6156808,@6.6190322,@6.6202251,@6.6182382,@6.618,@6.61923,@6.6091354,@6.6111987,@6.6108543,@6.6109963,@6.6154122,@6.6058803,@6.5805994,@6.5872213,@6.58,@6.5742,@6.5781313,@6.545917,@6.54438,@6.5561312,@6.533038,@6.5039898,
             /*2018-01*/
             @6.51,@6.51,@6.494,@6.504,@6.493,@6.488,@6.487,@6.48847,@6.498,@6.53,@6.508,@6.50,@6.454,@6.460,@6.463,@6.43678,@6.443,@6.433,@6.421,@6.404,@6.399,@6.40,@6.405,@6.404,@6.3677,@6.32167,@6.316443,@6.3193,@6.32243,@6.3376359,@6.3221432,
             
             /*2018-02*/
             @6.31,@6.30,@6.30,@6.2986,@6.3023,@6.29015,@6.2850,@6.27,@6.327,@6.289,@6.29,@6.298,@6.3277,@6.341,@6.3446,@6.3450,@6.3465537,@6.3435,@6.341,@6.3473,@6.347,@6.3448,@6.3519,@6.3347,@6.306,@6.313867,@6.3306,
             
             /*2018-03*/
             @6.358,@6.3465,@6.346,@6.343,@6.3304,@6.338,@6.3265,@6.337,@6.336,@6.330,@6.329,@6.330,@6.327,@6.321,@6.310,@6.328,@6.330,@6.330,@6.332,@6.334,@6.335,@6.330,@6.3047,@6.303572,@6.3137,@6.3337,@6.316,@6.303,@6.316,@6.267,@6.278,@6.287,@6.2775,@6.273,
             
             /*2018-04*/
             @6.2734602,@6.279275,@6.28928,@6.3053052,@6.3048919,@6.305454,@6.3044838,@6.3043258,@6.3135,@6.2868,@6.2727,@6.29227,@6.2752,@6.2712,@6.2814,@6.2895,@6.27867,@6.2912,@6.295,@6.3164,@6.306,@6.333,@6.326,@6.326,
             /*@(NAN),@6.3043258,@(NAN),*/

             ];
}


+ (NSString *)currencyAreaWithPlacemark:(CLPlacemark *)placeMark {
    
    KLLog(@"nation - %@",placeMark.country);//当前国家
    KLLog(@"area - %@",placeMark.administrativeArea);//当前区域
    NSString *currencyArea = @"";
    //判断是否是欧元区
    NSArray *eurNationArr = @[@"德国",@"法国",@"意大利",@"荷兰",@"比利时",@"卢森堡",@"爱尔兰",@"西班牙",@"葡萄牙",@"奥地利",@"芬兰",@"立陶宛",@"拉脱维亚",@"爱沙尼亚",@"斯洛伐克",@"斯洛文尼亚",@"希腊",@"马耳他",@"塞浦路斯"];
    for (NSString *eurNationStr in eurNationArr) {
        if ([placeMark.country containsString:eurNationStr]) {
            currencyArea = @"欧洲";
            break;
        }
    }
    
    if ([currencyArea isEqualToString:@""]) {
        //判断是否是港澳台
        if ([placeMark.administrativeArea containsString:@"香港"] || [placeMark.administrativeArea containsString:@"Hong Kong"] ) {
            currencyArea = @"香港";
        } else if ([placeMark.administrativeArea containsString:@"澳门"] || [placeMark.administrativeArea containsString:@"Macao"] ) {
            currencyArea = @"澳门";
        } else if ([placeMark.administrativeArea containsString:@"台湾"]|| [placeMark.administrativeArea containsString:@"Taiwan"] ) {
            currencyArea = @"台湾";
        } else {
            //其他情况直接赋值
            currencyArea = placeMark.country;
        }
    }
    return currencyArea;
}

@end
